const url = 'http://127.0.0.1:8080/data'
Page({
  onLoad(){
    let that = this
    wx.request({
      url,
      success(res){
        console.log(res)
        that.setData({
          ...res.data
        })
      }
    })
  },
  submit(e){
    console.log(e)
    wx.request({
      method: 'post',
      url,
      data:e.detail.value,
      success:res=>{
        console.log(res)
        this.setData(res.data)
      },
      fail:err=>{
        console.log(err)
      }
    })
  }
})
